﻿
Partial Class Eventos_Default2
    Inherits System.Web.UI.Page

    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim objBEInscrito As New extranet.BE.BEInscrito()

        objBEInscrito.Nome = Nome.Text
        objBEInscrito.IdEvento = Label1.Text
        objBEInscrito.Aprovado = False
        objBEInscrito.Cep = Cep.Text
        objBEInscrito.Cidade = Cidade.Text
        objBEInscrito.Cpf = CPF.Text
        objBEInscrito.DataNascimento = New Date(Convert.ToInt32(Data.Text.Split("/")(2)), Convert.ToInt32(Data.Text.Split("/")(1)), Convert.ToInt32(Data.Text.Split("/")(0)))
        objBEInscrito.Email = Email.Text
        objBEInscrito.Endereco = Endereco.Text
        objBEInscrito.Estado = UF.Text
        objBEInscrito.Pais = Pais.Text
        objBEInscrito.TelefoneCelular = TelCelular.Text
        objBEInscrito.TelefoneResidencial = TelResidencial.Text
        objBEInscrito.Sexo = txtSexo.Text

        Try
            extranet.BC.BCInscrito.InscreverNoEvento(Label1.Text, objBEInscrito)
            System.Web.HttpContext.Current.Response.Write("<SCRIPT LANGUAGE=""JavaScript"">" & vbCrLf)
            System.Web.HttpContext.Current.Response.Write("alert(""Sucesso!"")" & vbCrLf)
            System.Web.HttpContext.Current.Response.Write("</SCRIPT>")
        Catch ex As ApplicationException
            System.Web.HttpContext.Current.Response.Write("<SCRIPT LANGUAGE=""JavaScript"">" & vbCrLf)
            System.Web.HttpContext.Current.Response.Write("alert(""Erro!"")" & vbCrLf)
            System.Web.HttpContext.Current.Response.Write("</SCRIPT>")
        End Try



    End Sub

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not IsPostBack Then
            Label1.Text = Request.QueryString("Evento")
        End If
    End Sub

   
    Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click
        Response.Redirect("AdmEvtGerenciamentoEvento.aspx?Evento=" & Label1.Text)

    End Sub
End Class
